<?php
namespace app\api\controller;


class ZhInvite extends Common
{
    //家长列表
    function parents()
    {
        $uid = $this->request->uid;
        return $this->memberList($uid);
    }

    //佳人列表
    function authentication(){
        $uid = $this->request->uid;
        return $this->memberList($uid);
    }

    function memberList($pid){
        $limit = $this->request->get('limit', 20, 'intval');
        $page  = $this->request->get('page', 1, 'intval');
        $res = \app\api\model\Member::where('p_id', $pid)->field('nickname,phone,create_time')->paginate(['list_rows' => $limit, 'page' => $page])->toArray();
        foreach ($res['data'] as &$v) {
            $v['create_time'] = date('Y-m-d H:i:s', $v['create_time']);
        }
        return $this->ajaxReturn($this->successCode, '返回成功', $res);
    }
}